#include <iostream>

//template<class T>
class task
{
  private:
    int a;
    int b;
    char c;
  public:
    task(const int& _a,const int& _b,const char& _c):a(_a),b(_b),c(_c)
    {
    }
    task()
    {}
    void Run()
    {
      int z = 0;
            switch(c ){
                case '+':
                    z = a + b;
                    break;
                case '-':
                    z = a - b;
                    break;
                case '*':
                    z = a * b;
                    break;
                case '/':
                    if(b == 0) std::cerr << "div zero!" << std::endl;
                    if(b != 0) z = a / b;
                    break;
                case '%':
                    if(b == 0) std::cerr << "mod zero!" << std::endl;
                    if(b != 0) z = a % b;
                    break;
                default:
                    perror("operator error!\n");
                    break;
            }
            std::cout << "thread: [" << pthread_self() << " ]: " <<a << c  << b << "=" << z << std::endl;
    }
};
